/**
 * Copyright (c) 2015 www.smarthome.com All rights reserved. <br />
 * 本软件源代码版权归xxxx公司,未经许可不得任意复制与传播.<br />
 *
 */
package com.smarthome.domain.enums;

/**
 * 设备供应商--枚举类
 *
 */
public enum EquipmentProduEnum {
	/***奥普***/
    DEV_PRO_AOPU("aopu", "奥普"),
    
    /***海康***/
    DEV_PRO_HK("hk", "海康"),
    
    /***欧伯特***/
    DEV_PRO_OBT("obt", "欧伯特");
    
    private String code;
    private String name;

    private EquipmentProduEnum(String  code, String name) {
        this. code =  code;
        this.name = name;

    }

    public String getCode() {
        return  code;
    }

    public String getName() {
        return name;
    }
    
    /**
     * 通过id，得到名称
     * @param code
     * @return
     */
    public static String getNameById(String id){
		String name = "";
		for(EquipmentProduEnum e : EquipmentProduEnum.values()){
			if(e.getCode().equals(id)){
				name = e.getName();
				break;
			}
		}
		return name;
	}
    
    
}
